Delbin: Report internal error.
authorrobertl <robertl>
Wed, 18 Nov 2009 15:10:32 +0000 (15:10 +0000)
committerrobertl <robertl>
Wed, 18 Nov 2009 15:10:32 +0000 (15:10 +0000)
delbin.c

index 2359de58dfa75fbb1552bfcb6a9f4a959e65b7b8..48b499f41544f92e694bdeccb2dd1d5e905da9ba 100644 (file)
--- a/delbin.c
+++ b/delbin.c
@@ -151,6 +151,7 @@ static waypoint** wp_array;
 #define MSG_CAPABILITIES 0xb001
 #define MSG_DELETE 0xb005
 #define MSG_DELETE_SIZE 67
+#define MSG_ERROR 0xa003
 #define MSG_NAVIGATION 0xa010
 #define MSG_REQUEST_ROUTES 0xb051
 #define MSG_REQUEST_ROUTES_SIZE 65
@@ -772,6 +773,10 @@ message_read(unsigned msg_id, message_t* m)
                if (id == 0) {
                        break;
                }
+               if (id == MSG_ERROR) {
+                       const gbuint8* p = m->data;
+                       fatal(MYNAME ": device error %u: \"%s\"\n", *p, p + 1);
+               }
                message_ack(id, m);
                if (id == msg_id || time(NULL) - time_start >= READ_TIMEOUT) {
                        break;